function P=RPS_step_player(G,P,k)
%get opponent player
k2=opponent(k);
P2=G.P{k2};

%set player's states (Vars) in current step
P.score=calc_score(P,P2);
P.Vars=[P.action,P.score];

%calculate player's action in next step
P.action=calc_action(P,P2);

%update player's position
pos_list=[
0.4,0.1;
0.2,0.6;
0.7,0.5
];
P.pos=pos_list(P.action,:)+(k-1)*0.1;


function new_score=calc_score(P,P2)
Rock=1;Scissors=2;Paper=3;
alpha1=2;alpha2=1/2;beta=0;
a=[
0,alpha1,alpha2;
alpha2,0,alpha1;
alpha1,alpha2,0
];
if P.action==P2.action,
    new_score=P.score+beta;
else,
    new_score=a(P.action,P2.action)*P.score;
end;
%disp([P.action,P2.action,P.score,new_score])



function new_act=calc_action(P,P2)
switch P.strategy
case 'random'
    new_act=rand_int(1,3);
case 'maximin'
    new_act=rand_int(1,3);
otherwise
    new_act=rand_int(1,3);
end;


